014 data acquisition

本次讲座我们将学习如何记录数据并从 P.L. 获取数据。
And this lecture we're going to learn how to log data and acquire data from our P.L.

查看我们的溜冰者的系统并将其存储到续集数据库中。
see through our skater's system and store it into a sequel database.

因此,我们首先要设置一些东西,以确保一切顺利开始。
So there are a few things we're going to set up first just to make sure that we get everything running smoothly to start with.

您会在虚拟机的右下角看到这个小网络图标。
You see this little network icon in the bottom right of your VM.

我希望你右键单击它并选择打开网络和共享中心。
I want you to right click that and select Open Network and sharing center.

然后我们将单击“Windows 防火墙”,您想要打开或关闭“Windows 防火墙”。
Then we're going to click into Windows Firewall and you want to turn Windows Firewall on or off.

让我们继续将其私人和公共关闭,然后单击“确定”并关闭,并在重新启动后回来时重新启动计算机。
And let's go ahead and turn that off both private and public and then hit OK and close out of there and restart your computer when you come back after you restart.

然后我希望您过来这里并右键单击您的电脑图标,然后让我们从那里进行管理。
Then I want you to come over here and right click on your PC icon and let's go in to manage from there.

我希望您扩展服务,然后打开续集服务器配置管理器,然后双击续集服务器。
I want you to expand services and then open up sequel server configuration manager and then double click on sequel server.

让我们确保您的续集服务器处于运行状态。
Let's make sure that your sequel server is in the state running.

如果它没有运行那就右键单击它并点击开始。
If it's not running That's right click on that and hit start.

这是第一件事。
That's the first thing.

一旦我们到达这一点并且我们的续集服务器正在运行,我们就应该准备好进入下一步。
Once we get to that point and our sequel server is running we should be ready to go to the next step.

右键单击桌面。
Right click on the desktop.

我希望您创建一个新的文本文档,我们将重命名这个文件的名称和扩展名。
And I want you to create a new text document and we're going to rename this thing name and extension.

因此,我们将其称为测试数据库 dot you DL,并确保末尾没有点 t x t。
So let's call it test database dot you DL and make sure that you don't have a dot t x t at the end.

按 Enter 键,它会询问您是否确定要更改扩展名,然后再次按 Enter 键,然后再按一次 Enter 键并查看。
Hit enter and it's going to ask if you're sure you want to change the extension and go ahead and hit enter again and then hit enter one more time and look at that.

我们有一种测试数据链路的方法。
We've got a way to test data links.

因此,返回此提供商选项卡,我希望您选择 Microsoft OLED 提供商作为续集服务器,点击下一步,然后选择 N 号以使用 Windows inti 集成安全性。
So come back into this provider tab and I want you to select Microsoft OLED provider for sequel server hit next and then N-number to use Windows inti integrated security.

然后第三步单击此下拉列表,应该需要几秒钟的时间,然后您应该会在下面看到一个数据库列表。
And then number three click this dropdown and it should take a few seconds and then you should have a list of your databases appearing below.

如果这有效,那么你就很好了,你实际上不需要做任何其他事情。
If that works you're good and you don't really need to do anything else.

您可以点击取消,并且您可能想保留该测试数据库文件,因为正如您所看到的,这很方便,特别是当您遇到任何数据库连接问题时。
You can just hit cancel and you might want to hang on to that test database file because as you can see that comes in handy especially if you ever run into any database connectivity problems.

假设您已完成所有工作,我们就可以立即开始。
Assuming you've got all that working we're ready to jump right in.

所以我要让我的 ORU 链接运行,打开我的模拟启动我的 PEOC 程序,这个家伙已经处于运行模式。
So I'm going to get my ORUs links running turn on my emulate start up my PEOC program and this guy is already in run mode.

让我们继续为我们的逻辑授予权限。
And let's go ahead and give permissions to our logic's that get going.

我可以把它放到网上,看起来一切都很好。
I can put that on line looks like everything's good.

现在我要再次打开我的内衣。
Now I'm going to get my underwear open again.

当它打开时,我将继续启动我的电脑。
And while that's opening I'm going to go ahead and start my P C up.

这就是切换并将我的所有设备置于自动控制模式。
So that's toggle that and put all of my devices into auto control mode.

然后我将拉动我的开始按钮并让我的系统运行。
Then I'm going to tug on my start button and get my system to run.

好的。
All right.

因此,从那时起,我们将让所有这些东西运行,同时你和我将进入 Microsoft 续集 Server Management Studio,它应该会为你弹出一个漂亮的小窗口,看起来像这样我们会接受这个。
And so from that point we're going to let all of that stuff run and you and I in the meanwhile are going to go into Microsoft sequel Server Management Studio and it should pop up for you with a nice little window that looks something like this and we're going to take that.

我们将使用默认服务器名称和 Windows 身份验证连接到数据库引擎。
We're going to be connecting to the database engine with our default server name and windows authentication.

让我们继续点击连接,这将使我们进入我们的续集服务器。
Let's go ahead and hit connect and that's going to get us into our sequel server.

我们需要创建一个新的数据库,这听起来非常复杂和可怕,但事实并非如此。
We need to create a new database which sounds really complicated and scary but it's really not.

只需右键单击数据库即可。
Just click on the databases right click.

我希望您单击新数据库。
And I want you to click new database.

当比尔·盖茨在后台思考时,您可以为这个数据库想出您自己的创意名称。
And while Bill Gates is thinking in the background you can come up with your own creative name for what you want to call this database.

开始了。
Here we go.

对于我们的数据库名称,您可以随意称呼它,但我会称我的为 P.L.
And for our database name you can call it whatever you want but I'll call mine P.L.

C-3。

C-3.

多么合适啊。
How appropriate.

正确的。
Right.

一旦我知道了,我就会点击“确定”。
And once I've got that I'm just going to hit OK.

我已经完成了。
And I'm already done.

我已经创建了新的数据库,因此我们现在可以继续关闭管理工作室。
I have created my new database so we can go ahead and close out of the management studio now.

我们回到了熟悉的领域,我们回到了想知道在哪里,让我们打开我的主屏幕。
And we're back into familiar territory we're back to wonder where and let's get to my main screen open.

好的。
OK.

这看起来就像我离开的地方。
That looks like where I left off.

我们想要与数据库进行通信,因此我们必须在程序中设置数据库。
We want to communicate with the database so we have to set up the database in our program.

让我们单击项目并进入选项。
Let's click on project and go into options.

我们已经有了这个默认数据库,让我们继续单击它。
We've got this default database and let's go ahead and click on that.

然后对于这个连接字符串,我们将单击其右侧的三个点。
And then for this connection string we're going to click on the three dots to the right of that.

这看起来应该非常熟悉,因为您几分钟前刚刚经历过类似的数据链接实验。
And this should look very familiar because you just went through a similar data link experiment a couple of minutes ago.

因此,让我们再次单击此用于续集服务器的 Microsoft OLP DBI 提供程序,然后单击“下一步”。
So let's click on this Microsoft OLP DBI provider for sequel server once again and click next.

然后我们将使用 Windows inti 集成安全性,然后单击此下拉菜单。
Then we're going to use Windows inti integrated security and we're going to click on this drop down.

但现在我们不应该看到四件事,而应该看到五件事,我们将继续采取我们的 P.L.
But now instead of seeing four things we should see five and we're going to go ahead and take our P.L.

查看我们刚刚创建的三个或您决定命名的任何名称。
see three that we just created or whatever you decided to name yours.

现在让我们测试连接。
And now let's test the connection.

当然,我们知道它会成功。
And of course we know it's going to be successful.

是的。
Yes it is.

然后我们就可以点击确定了。
Then we can hit OK.

再次点击“确定”,最后一次点击“确定”。
Hit OK again and hit OK one last time.

现在让我们来创造一些奇迹吧。
Now let's make some magic happen.

我们要到这里来执行任务。
We're going to come down here into tasks.

右键单击趋势并选择插入。
Right click on trend and select insert.

我们已经有了这个历史格式。
We've got this history format.

我们将把它放入数据库并配置我们的数据库。
We're going to put that into a database and to configure our database.

我们将使用项目默认值并使用默认名称并自动创建。
We're just going to go with Project default and use default name and automatically create.

所以那里一切都很好。
So everything is good there.

然后我将在此处添加一个标签,这将是我的水箱液位。
And then I'm going to add a tag right here and that's going to be my tank level.

让我们继续并点击“确定”。
Let's go ahead and hit OK.

现在这被设置为在触发器上保存,并且该触发器是第二个,这是 Wonder 的内部标签,显然这意味着它将每秒保存这个东西。
And right now this is set to save on a trigger and that trigger is second which is an internal tag for Wonder where obviously that means it's going to save this thing every second.

但如果我们愿意,我们可以将其保存到我们自己的标签之一。
But we could save this to one of our own tags if we wanted to.

然后我们将按需记录数据。
And then we would logged data on demand.

请记住这一点,因为这将在您的上一个项目中派上用场。
Remember that because that's going to come in handy in your last project.

因此,现在让我们继续并单击全部保存,我们将获取第一张工作表,然后我们可以关闭它。
So for now let's go ahead and click save all and we're going to take sheet number one and then we can close that.

现在让我们开始跑步吧。
And now let's just go ahead and go into run.

果然一切都会弹出。
And sure enough everything pops up.

我们将会看到我们的坦克正在坠落。
We're going to see that our tank is falling.

我们正在奔跑。
We are running.

我们的趋势分析屏幕上出现了一些数据,因此一切看起来都不错,我们应该每秒在数据库中记录水箱液位。
We've got some data coming in on our trend analysis screen so everything looks good and we should be logging our tank level in our data base every second.

那么我们是否这样做呢?
So are we doing that or not.

让我们来看看吧。
Let's find out.

这就是所有选项卡。
That's all tab.

我们已经关闭了续作 Server Management Studio。
And we already closed our sequel Server Management Studio.

所以让我们继续把它拉回来。
So let's go ahead and pull that back up.

首先应该关闭它。
Should close that in the first place.

我没有提前考虑,我要连接到那里。
I wasn't thinking ahead and I'm going to connect into there.

现在让我们扩展数据库。
Now let's expand databases.

我们将扩大 P.L.
We're going to expand P.L.

C-3 我们将扩展表并查看我们的应用程序创建的表。
C-3 and we're going to expand tables and look at that that's the table that our application created.

我们将右键单击它并选择前 1000 行。
And we're going to right click on that and say select top 1000 rows.

当我们这样做时,需要一点时间。
And when we do it's taking a little bit.

比尔·盖茨正在思考他的仓鼠在小轮子上跑来跑去并检查一下。
Bill Gates is thinking his hamsters running around on its little wheel and check it out.

我们已经每秒获得大量数据,并且我们已经运行了 74 秒,并且我们已经获得了所有这些水箱液位。
We've got tons and tons of data already for every second and we've been running for 74 seconds now and we've got all those tank levels.

因此,考虑一下您可以登录续集服务器的所有内容,然后如果您了解一些续集,例如如何编写像这样的酷有趣的查询,您可以提取数据并提供各种报告并执行各种操作对您的系统进行分析。
So think about all of the things that you could log into sequel server and then if you knew a little bit of sequel like how to write cool interesting queries like this you could pull that data out and give all kinds of reports and do all kinds of analyses on your system.

这不是一个报告课程,所以我们不打算讨论这个。
This isn't a reporting course so we're not going to get into that.

请不要给我发消息询问复杂的续集问题。
And please don't message me asking me for complex sequel queries.

我不是提供帮助的人,但我是向您展示如何将数据保存到服务器中的人。
I'm not the guy to help but I am the guy to show you how to get the data to save into your server.

就是这样。
And here it is.

我们现在正在减少数据。
We are now that abasing data.

所以它比其他一些东西要复杂一些。
So it was a little bit more complicated than some of the other stuff.

但您现在知道如何保存数据并检查它。
But you now know how to save data and check it out.

至此,您已经掌握了一些相当高级的 HDMI 技能和滑行技巧,但我们不要满足于此。
At this point you've got some pretty advanced HDMI skills and skating skills but let's not rest on our laurels here.

你听说过。
You've heard about it.

你已经看到了。
You've seen it.

现在是时候进去做这件事了。
Now it's time to get in there and do it.

我们将结束这一部分。
We'll wrap this section up.

接下来我们将开始将所有这些很酷的东西投入使用。
And in the next we're going to start putting all this cool stuff to work.

我知道你已经准备好接触内衣而不是内衣,但不知道在哪里,别担心。
I know you're ready to get your hands on underwear not underwear but wonder where and don't worry.

我们很快就会为您提供大量内容。
We're going to give you a ton of it coming up soon.

那么我们下一节见。
So see you in the next section.

第一个项目并做好准备。
First project and get ready.

我们会玩得很开心。
We're going to have fun.

回头见。
See you then.

干杯
Cheers